import 'package:flutter/material.dart';
import 'package:flutter_fresh_mall_app/common/global/counter.dart';
import 'package:flutter_fresh_mall_app/common/global/routers.dart';
import 'package:flutter_fresh_mall_app/page/index.dart';
import 'package:provider/provider.dart';

void main() {
  // 创建全局共享状态监听器
  runApp(MultiProvider(
    providers: [
      ChangeNotifierProvider(create: (_) => Counter())
    ],
    child: MyApp(),
  ));
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      theme: ThemeData(primarySwatch: Colors.cyan),
      routes: Routers.routes,
      home: IndexPage(),
    );
  }
}
